/*
    This file is part of Starlight Engine.

    Starlight Engine is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    Starlight Engine is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Starlight Engine.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Diagnostics;

namespace StarlightEngine
{
    /// <summary>
    /// Controls logging functions within the engine.
    /// </summary>
    public static class Logger
    {
        /// <summary>
        /// Writes the specified content to the debug streams.
        /// </summary>
        /// <param name="content">The content.</param>
        public static void Write(string content, int level)
        {
            Debug.WriteLine(String.Format("[{0} - {1}] : {2}", StringFromLevel(level), DateTime.Now, content));
        }

        static string StringFromLevel(int level)
        {
            switch (level)
            {
                case 1:
                    return "Trace";
                case 2:
                    return "Debug";
                case 3:
                    return "Error";
                case 4:
                    return "Critical";
                case 5:
                    return "Fatal";
            }
            return "Error";
        }
    }

}



